<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="utils.js"></script>
</head>
<body>
    <h1>获取输入的时间距离现在的时间</h1>
    <div id="demo1"></div>
    <script>
        var result = ""

        result += `dateFormat('2017-3-3 5:18:19')------${dateFormat('2017-3-3 5:18:19')} <br>`
        result += `dateFormat('2022-1-3 5:18:19')------${dateFormat('2022-1-3 5:18:19')} <br>`
        result += `dateFormat('2022-4-3 5:18:19')------${dateFormat('2022-4-3 5:18:19')} <br>`
        result += `dateFormat('2022-4-14 5:18:19')------${dateFormat('2022-4-14 5:18:19')} <br>`

        document.querySelector('#demo1').innerHTML = result
    </script>

    <h2>调用当前时间</h2>
    <div id="demo2"></div>
    <script>
        var result = '';
        result += `format('YmdHis')~~~~~~~~~~${format('YmdHis')}<br>`;
        result += `format('Y-m-d H:i:s')~~~~~${format('Y-m-d H:i:s')}<br>`;
        result += `format('Y-m-d ')~~~~~~~~~~${format('Y-m-d')}<br>`;

    document.querySelector('#demo2').innerHTML = result;
    </script>

    <h3>判断是浏览器类型</h3>
    <div id="demo3"></div>
    <script>
        var result = '';
        result += ` browser()~~~~~~~~~~${ browser()}<br>`;
        document.querySelector('#demo3').innerHTML = result;
    </script>

    
    <h4>判断是PC端还是移动端</h4>
    <div id="demo4"></div>
    <script>
        var result = '';
        result += `PcandYd()~~~~~~~~~~${PcandYd()}<br>`;
        document.querySelector('#demo4').innerHTML = result;
    </script>

    <h5>判断是否是微信浏览器</h5>
    <div id="demo5"></div>
    <script>
        var result = '';
        result += `weixin()~~~~~~~~~~${weixin()}<br>`;
        document.querySelector('#demo5').innerHTML = result;
    </script>

    <h5>判断标签样式</h5>
    <div id="demo6"></div>
    <script>
        var result = '';
        var divObj=document.querySelector('#demo6');
        result += `getStyle(divOBj,'color')~~~~~~~~~~${getStyle(divObj,'color')}<br>`;
        result += `getStyle(divOBj,'fontSize')~~~~~~~~~~${getStyle(divObj,'fontSize')}<br>`;
        result += `getStyle(divOBj,'width')~~~~~~~~~~${getStyle(divObj,'width')}<br>`;
        document.querySelector('#demo6').innerHTML = result;
    </script>


</body>
</html>